package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**易家推荐的商品
 * @author GuiyouZhang
 * Date：2015年12月30日 下午3:56:17
 * Email:guiyouzhang@163.com
 */
public class YijiaRecommend extends XtomObject implements Serializable {

	private static final long serialVersionUID = 1L;

	private String id;
	private String name;// 标题	
	private String keytype;// 广告类型	1：商品；2：商家；3：图文详情
	private String keyid;// 对应id	
	private String type;// 商品类型	
	//0唠嗑帖子；1田家农货；2有机；3地标；4村游；5田家日志；6特产；9乐乐；
	//71走走房车露营；72走走自驾车露营；73走走帐篷露营；74走走商品区；75走走房车；
	//81苗木；82花卉；83家电；84日用品；10众农
	private String role;// 商家类型	
	//1田家用户;2地标商家;3村游商家;4省级代理;5运营商;6乐乐商家;
	//7特产商家;8粮库商家;11走走露营商家;12走走房车商家;
	//21苗木;22花卉;23家电;24日用商品
	private String imgurl;// 广告图片	
	private String imgurl_detail;// 广告详情图片	keytype=3时广告详情图片，其他可以为空
	private String website_url;//不为null时,点击跳转website_url的网页
	private String regdate;// 发布日期	
	private String orderby;// 排序规则	由大到小排序
	
	

	public YijiaRecommend(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				id = get(jsonObject, "id");
				name = get(jsonObject, "name");
				keytype = get(jsonObject, "keytype");
				keyid = get(jsonObject, "keyid");
				type = get(jsonObject, "type");
				role = get(jsonObject, "role");
				imgurl = get(jsonObject, "imgurl");
				imgurl_detail = get(jsonObject, "imgurl_detail");
				website_url = get(jsonObject, "website_url");
				regdate = get(jsonObject, "regdate");
				orderby = get(jsonObject, "orderby");

				log_i(toString());
			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}

	@Override
	public String toString() {
		return "YijiaRecommend [id = "+id+"name=" + name + ", keytype=" + keytype
				+ ", keyid=" + keyid + ", type=" + type + ", role=" + role
				+ ", imgurl=" + imgurl + ", imgurl_detail=" + imgurl_detail
				+ ", website_url=" + website_url + ", regdate=" + regdate
				+ ", orderby=" + orderby + "]";
	}

	public String getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getKeytype() {
		return keytype;
	}

	public String getKeyid() {
		return keyid;
	}

	public String getType() {
		return type;
	}

	public String getRole() {
		return role;
	}

	public String getImgurl() {
		return imgurl;
	}

	public String getImgurl_detail() {
		return imgurl_detail;
	}

	public String getWebsite_url() {
		return website_url;
	}

	public String getRegdate() {
		return regdate;
	}

	public String getOrderby() {
		return orderby;
	}

}
